package domain.server;

import game.GameData;
import game.IGameData;

import java.net.ServerSocket;
import java.util.Iterator;

import domain.league.League;
import domain.tournament.Tournament;

import technicalservices.error.ErrorHandler;
import application.config.Config;
import application.config.Config.Status;

/**
 * The ServerProtcol class works as a protocol for the system. This protocol
 * acts like the "middle-man" between the Arena system and the clients in a
 * general way, excluding details such as game rules etc.
 */
public class ServerProtocol implements IGameListProtocol, IGameProtocol {

	private ServerSocket serverSocket;
	
	public ServerProtocol() {
		try {
			this.serverSocket = new ServerSocket(Config.PROTOCOL_PORT);
		} catch (Exception e) {
			ErrorHandler.getInstance().showError("ServerProtocol generated the following error:\n" + e);
		}
	}

	@Override
	public void startGame() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void sendObject(Object object) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Object receiveObject() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void sendCommand(Status command) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public int receiveCommand() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void joinGame(IGameData gameData) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void quitGame() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void spectateGame(IGameData gameData) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Iterator<GameData> getGames() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Iterator<Tournament> getTournaments(int gameId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Iterator<League> getLeagues(int gameId) {
		// TODO Auto-generated method stub
		return null;
	}

}
